#!/bin/bash
set -e
set -x
MYDIR="${0%/*}"
cd "$MYDIR/.."
source "recipes/common.sh"


# RECIPE START time

reset_mtime time time/configure.in
rm -rf build/time
mkdir -p build/time
cd build/time
env ${AUTOCRAP_KLUDGE} \
CC="${TARGET}-gcc" \
CPPFLAGS="-DHAVE_SYS_RESOURCE_H $CPPFLAGS" \
../../time/configure \
	${CONFIGURE_ARGS} \
	$NIL

make -j${JOBS}
# XXX: make install ignores DESTDIR
mkdir -p "${stage}${prefix}/bin"
cp -af time "${stage}${prefix}/bin/time"
cd ../..

rm -rf build/time

# RECIPE END time
